package com.toune.movie.mvp.adapter;

import android.support.annotation.Nullable;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.bumptech.glide.request.RequestOptions;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.toune.movie.R;
import com.toune.movie.vo.SearchVo;

import java.util.List;

public class AdapterSearch extends BaseQuickAdapter<SearchVo, BaseViewHolder> {
    public AdapterSearch(int layoutResId, @Nullable List<SearchVo> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, SearchVo item) {
        ImageView imageView = helper.getView(R.id.img_iv);
        Glide.with(mContext).load(item.getImgURL()).apply(new RequestOptions().placeholder(R.mipmap.holder).error(R.mipmap.holder)).into(imageView);
        helper.setText(R.id.title_tv, item.getTitle());
    }
}
